

<template tag="以下文档内容为hycli自动生成">
  <el-dialog
    v-model="conf.visible"
    
    :title="title"
    :width="conf.width"
    draggable
    align-center="true"
    :close-on-click-modal="false"
  >
<el-form :model="form"  ref="form" :rules="rules_aaaqr">
    <el-row>
    <el-col :span="12">
    <!-- {"index":29,"raw":"cc_tp","name":"cc_tp","cname":"CcTp","type":{"raw":"varchar2(32)","name":"varchar2","len":32,"dlen":0},"defValue":"","allowNull":false,"constraints":["q","l","le","c","u","v","sl","tp(radio,c-u)"],"desc":{"raw":"任务类型","name":"任务类型"}} -->
    <el-form-item prop="cc_tp" label="任务类型" label-width="100px" label-position="right">
      <el-radio-group v-model="form.cc_tp"   >
        <el-radio-button v-for="item in cc_tpList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="24">
    <!-- {"index":30,"raw":"staff_id","name":"staff_id","cname":"StaffId","type":{"raw":"varchar2(64)","name":"varchar2","len":64,"dlen":0},"defValue":"","allowNull":false,"constraints":["q","l","le","c","u","v","sl(dmaster,-,#lob_id)","tp(radio,c-u)"],"desc":{"raw":"人员","name":"人员"}} -->
    <el-form-item prop="staff_id" label="人员" label-width="100px" label-position="right">
      <el-radio-group v-model="form.staff_id"   >
        <el-radio-button v-for="item in staff_idList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="24">
    <!-- {"index":31,"raw":"content","name":"content","cname":"Content","type":{"raw":"varchar2(2000)","name":"varchar2","len":2000,"dlen":0},"defValue":"","allowNull":false,"constraints":["l","le","c","u","v","rows(8)","lw(200)"],"desc":{"raw":"内容","name":"内容"}} -->
    <!--内容 输入控件 -->
    <el-form-item prop="content" label="内容" label-width="100px" label-position="right">
      <el-input clearable style="width: 100%" v-model="form.content"  maxlength="2000" 
      :rows="8"  type="textarea" show-word-limit  placeholder="请输入内容"  />
      </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":32,"raw":"deal_tp","name":"deal_tp","cname":"DealTp","type":{"raw":"varchar2(32)","name":"varchar2","len":32,"dlen":0},"defValue":"","allowNull":false,"constraints":["l","le","c","u","v","sl","tp(radio,c-u)","color"],"desc":{"raw":"处理方式","name":"处理方式"}} -->
    <el-form-item prop="deal_tp" label="处理方式" label-width="100px" label-position="right">
      <el-radio-group v-model="form.deal_tp"   >
        <el-radio-button v-for="item in deal_tpList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    </el-row>
</el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="hide" icon="close">取消</el-button>
        <el-button type="primary" @click="save" icon="select">提交</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script>
import rtext from "@/views/cmpnts/rtext.vue"
export default {
  components: {
    rtext
},
  data() {
    return {
      conf: {
        visible: false,
        width:"60%",
        uploadPath:this.$theia.env.join("/file/upload"),
      },
      title:"修改企业文化",
rules_aaaqr:{
    cc_tp:[{required:true,message:"请输入任务类型",trigger: 'blur'}],
    staff_id:[{required:true,message:"请输入人员",trigger: 'blur'}],
    content:[{required:true,message:"请输入内容",trigger: 'blur'}],
    deal_tp:[{required:true,message:"请输入处理方式",trigger: 'blur'}],
  },
    form:{
        cc_tp:"",
        staff_id:"",
        content:"",
        deal_tp:"",
    },
    cc_tpList:[],
    staff_idList:[],
    deal_tpList:[],
    }
  },
  methods: {
    show(form) {
      this.conf.visible = true;
      this.loadEnums_aaaqr()
      this.form = Object.assign(form,this.$route.params)
      this.get(form)
    },
      get(form){
        let that = this
        this.conf.loading = true
        let postForm = {}
        postForm.cc_id = form.cc_id
        this.$theia.http.get("/ws/corp/culture",postForm).then(res=>{
          that.form = Object.assign(that.form, res)
        //处理枚举重新绑定
          this.loadEnums_aaaqr()
          that.conf.loading = false
        }).catch(res=>{
          let code = ((res||{}).response||{}).status||0
          let msg = `企业文化查询失败(${code})`
          that.$notify.error({title: '失败',message:msg ,duration:5000})
        })
    },
    save(){
        this.$refs.form.validate((v=>{
            if(v) this.onSave()
        }))
    },
    onSave(){
      let that = this
        let postForm = Object.assign({},this.form)
        this.$theia.http.put("/ws/corp/culture",postForm).then(res=>{
            that.$notify.success({title: '成功',message: '企业文化保存成功',duration:5000})
            that.hide()
            that.$emit("onsaved")
        }).catch(res=>{
            let code = ((res||{}).response||{}).status||0
            let msg = `企业文化修改失败(${code})`
            that.$notify.error({title: '失败',message: msg,duration:5000})
        })
    },
    hide() {
      this.conf.visible = false;
      this.$refs.form.resetFields();
    },
     onUploadSuccess(response){
    },
    loadEnums_aaaqr(){
        //任务类型
        this.cc_tpList = this.$theia.enum.get("cc_tp","","" ,false,"")
        //人员
        this.staff_idList = this.$theia.enum.get("dmaster","",this.$theia.user.get("lob_id"),false,"")
        //处理方式
        this.deal_tpList = this.$theia.enum.get("deal_tp","","" ,false,"")
    },

  },
};
</script>

<style scoped>
.form_item_info{
  margin-left: 4px;
  color:#999;
}
.form_item_info:hover{
  cursor: pointer;
  font-weight: 500;
  color:#333;
}
</style>